<script setup lang="ts">
import type { Column } from '@/data-table/def';
import { DataTable } from '@/index'
import { ref } from 'vue';

const columns = ref<Column[]>([
  {
    caption: '类别',
    field: 'group',
    type: 'string',
    width: 120,
  },
  {
    caption: '厂家',
    field: 'from',
    type: 'string',
  },
  {
    caption: '责任人',
    field: 'orner',
    type: 'string',
  },
  {
    caption: '保质期',
    field: 'life',
    type: 'string',
  },
  {
    caption: '金额',
    field: 'fee',
    type: 'string',
  },
  {
    caption: '日期',
    field: 'date',
    type: 'string',
  },
  {
    caption: '备注',
    field: 'date',
    type: 'string',
    minWidth: 120
  },
])

const datas = ref<any[]>([
  {
    group: '生活用品',
    from: '沃尔玛',
    date: '2022-12-24'
  }
])
</script>

<template>
  <DataTable :columns="columns" :datas="datas" />
</template>

<style>
html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
</style>
